# -*- coding: utf-8 -*-
"""
Created on Tue Jun  5 21:16:41 2018

@author: Administrator
"""

#%%
#split the Yep template into 90 files.
from agilepipe.process.mask import Split_aaltemplate_1

source_filepath = r'/media/root/Elements4/XuanWu_dpabi_spm/mask/AAL_template_single/AAL_61x73x61_YCG.nii'
anatomy_index = range(1,91)
Split_aaltemplate_1([source_filepath,anatomy_index])

#%%

#%%
from agilepipe.process.mask import Intersect_2mask

blur_mask1_dirpath = r'/media/root/Elements4/XuanWu_dpabi_spm/mask/T1_SC_SS_GM_SN_SR_LM-'
mask1_dirpaths = [blur_mask1_dirpath +'0.'+str(i) for i in range(4,10)]

mask2_dirpath = r'/media/root/Elements4/XuanWu_dpabi_spm/mask/AAL_template_single/AAL_61x73x61_YCG_divided_mask'

for mask1_dirpath in mask1_dirpaths:
  Intersect_2mask([mask1_dirpath,mask2_dirpath])